package com.cjst.controller.api.login;

import java.util.HashMap;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cjst.pojo.base.MultiAccount;
import com.cjst.service.base.MultiAccountService;
import com.cjst.sql.C;
import com.cjst.sql.Method;
import com.cjst.sql.WherePrams;
import com.cjst.util.code.VerifyCode;
import com.cjst.util.common.CommonConstant;
import com.cjst.util.common.GenerativeToken;
import com.cjst.util.common.ResultCode;
import com.cjst.util.json.ResultObj;

@Controller
@RequestMapping("/api/wx")
public class WXLoginController {
	protected final Logger log = Logger.getLogger(WXLoginController.class);
	
	@Autowired
	private MultiAccountService multiAccountService;
	
	@RequestMapping(value="/login",method = RequestMethod.POST)
	@ResponseBody
	public String login(String code){
	
		WherePrams wherePrams=Method.where("wxAppletOpenid", C.EQ, code);
		
		MultiAccount multiAccount=multiAccountService.get(wherePrams);
		
		if (multiAccount != null) {
			String faceIdentification = multiAccount.getFaceIdentification();
			if (faceIdentification == null || faceIdentification.length() < 5) {

			}
		}
		
		ResultObj robj = new ResultObj(ResultCode.RESULT_SUCCESS, "success","6QST5AWMXJ92TWDH06DE59576F54449886448F941A541460");
        return robj.toString();
	}

}
